package tech.dort.dortware.impl.modules.exploit;

import com.google.common.eventbus.Subscribe;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import tech.dort.dortware.api.module.Module;
import tech.dort.dortware.api.module.ModuleData;
import tech.dort.dortware.impl.events.PacketEvent;

public class NoRotate extends Module {

    public NoRotate(ModuleData moduleData) {
        super(moduleData);
    }

    @Subscribe
    public void onPacket(PacketEvent event) {
        switch (event.getPacketDirection()) {
            case INBOUND:
                if (event.getPacket() instanceof S08PacketPlayerPosLook) {
                    S08PacketPlayerPosLook packetPlayerPosLook = event.getPacket();
                    packetPlayerPosLook.yaw = mc.thePlayer.rotationYaw;
                    packetPlayerPosLook.pitch = mc.thePlayer.rotationPitch;
                }
                break;
            case OUTBOUND:
                break;
        }
    }
}